package model

type IPages interface {
	GetOffset() int
	GetLimit() int
}
type Pages struct {
	Offset int `json:"offset" form:"offset" query:"offset"`
	Limit  int `json:"limit" form:"limit" query:"limit"`
}

func (p Pages) GetOffset() int {
	if p.Offset < 1 {
		return 0
	}

	return p.Offset
}

func (p Pages) GetLimit() int {
	if p.Limit < 1 {
		return 10
	}

	return p.Limit
}
